From ec15d20abac65bfda6c8e6396ce9fc2061f5067a Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Wed, 24 Apr 2024 14:52:57 +0100
Subject: ui(web): Show bookmark URL when maximizing a bookmark

---
 .../@modal/(.)preview/[bookmarkId]/page.tsx        | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 apps/web/app/dashboard/@modal/(.)preview/[bookmarkId]/page.tsx

(limited to 'apps/web/app/dashboard/@modal/(.)preview/[bookmarkId]/page.tsx')

diff --git a/apps/web/app/dashboard/@modal/(.)preview/[bookmarkId]/page.tsx b/apps/web/app/dashboard/@modal/(.)preview/[bookmarkId]/page.tsx
new file mode 100644
index 00000000..432e7a6c
--- /dev/null
+++ b/apps/web/app/dashboard/@modal/(.)preview/[bookmarkId]/page.tsx
@@ -0,0 +1,35 @@
+"use client";
+
+import { useState } from "react";
+import { useRouter } from "next/navigation";
+import BookmarkPreview from "@/components/dashboard/preview/BookmarkPreview";
+import { Dialog, DialogContent } from "@/components/ui/dialog";
+
+export default function BookmarkPreviewPage({
+  params,
+}: {
+  params: { bookmarkId: string };
+}) {
+  const router = useRouter();
+
+  const [open, setOpen] = useState(true);
+
+  const setOpenWithRouter = (value: boolean) => {
+    setOpen(value);
+    if (!value) {
+      router.back();
+    }
+  };
+
+  return (
+    <Dialog open={open} onOpenChange={setOpenWithRouter}>
+      <DialogContent
+        className="h-[90%] max-w-[90%] overflow-hidden p-0"
+        hideCloseBtn={true}
+        onOpenAutoFocus={(e) => e.preventDefault()}
+      >
+        <BookmarkPreview bookmarkId={params.bookmarkId} />
+      </DialogContent>
+    </Dialog>
+  );
+}
-- 
cgit v1.2.3-70-g09d2

